package com.emeraldparser.util;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

import com.google.common.collect.SetMultimap;
import com.google.common.collect.Table;

public abstract class AbstractSetMultitable<R, C, V> extends AbstractMultitable<R, C, V> implements SetMultitable<R, C, V> {

	public AbstractSetMultitable(Table<R, C, Collection<V>> table) {
		super(table);
	}

	@Override abstract Set<V> createCollection();

	@Override public Set<V> get(R rowKey, C columnKey) {
		return (Set<V>) super.get(rowKey, columnKey);
	}

	@Override public Set<Table.Cell<R, C, V>> cells() {
		return (Set<Table.Cell<R, C, V>>) super.cells();
	}

	@Override public Set<V> removeAll(Object rowKey, Object columnKey) {
		return (Set<V>) super.removeAll(rowKey, columnKey);
	}

	@Override public Set<V> replaceValues(R rowKey, C columnKey, Iterable<? extends V> values) {
		return (Set<V>) super.replaceValues(rowKey, columnKey, values);
	}

	@SuppressWarnings("unchecked")
	@Override public Table<R, C, ? extends Set<V>> asTable() {
		return (Table<R, C, ? extends Set<V>>) super.asTable();
	}

	@Override public boolean put(R rowKey, C columnKey, V value) {
		return super.put(rowKey, columnKey, value);
	}

	@Override public boolean equals(Object object) {
		return super.equals(object);
	}

	@SuppressWarnings("unchecked")
	@Override public Map<R, ? extends SetMultimap<C, V>> rowMap() {
		return (Map<R, ? extends SetMultimap<C, V>>) super.rowMap();
	}

	@SuppressWarnings("unchecked")
	@Override public Map<C, ? extends SetMultimap<R, V>> columnMap() {
		return (Map<C, ? extends SetMultimap<R, V>>) super.columnMap();
	}

	@Override public SetMultimap<C, V> row(R rowKey) {
		return (SetMultimap<C, V>) super.row(rowKey);
	}

	@Override public SetMultimap<R, V> column(C columnKey) {
		return (SetMultimap<R, V>) super.column(columnKey);
	}

}
